import java.util.Random;
import java.util.Scanner;

public class MethodDemo02 {
    public static void main(String[] args) {
        //请输入年，请输入月，请输入日，问今天是今年第多少天
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入年");
        int y = scanner.nextInt();
        System.out.println("请输入月");
        int m = scanner.nextInt();
        System.out.println("请输入日");
        int d = scanner.nextInt();

        calcDay(y,m,d);

    }

    /**
     * 传入一个年月日，就帮你计算今天是今年多少天
     *
     * @param y 年
     * @param m 月
     * @param d 日
     */
    public static void calcDay(int y, int m, int d) {
        int allDays = 0;
        for (int i = 1; i < m; i++) {
            if (i == 4 || i == 6 || i == 9 || i == 11) {
                allDays += 30;
            } else if (i == 2) {
                if (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) {
                    allDays += 29;
                } else {
                    allDays += 28;
                }
            } else {
                allDays += 31;
            }
        }
        allDays += d;
        System.out.println(allDays);
    }
}
